package cn.netjava.robo3d;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.util.List;

import javax.swing.JLabel;

import cn.netjava.robo3d.device.FireGun;

import com.jme.math.Vector3f;
import com.jme.scene.shape.Box;

/*
 * 坦克信息
 */
public class TankInformation {

	private float T;                 //拉力,由发动机产生
	private Box base;
	private Vector3f localtranslation;   //坦克位置
	private String name;
	private float F;                 //合力
	private float acceleration;      //加速度
	private float speed;			//速度
	private float blood;			//血量
	private float score;			//得分
	private float totalmass;      //车的总质量
	private Vector3f normal;   //坦克位置的法线
	private Vector3f cardirection;  //坦克指向
	private Vector3f leftdirection;  //坦克向左正方向
	private Vector3f slope;     //斜坡方向,也即重力分力方向
	private float angle;            //水平面法线与地面法线的夹角;
	private FireGun firegun;    //喷火枪
	private boolean endfireflag; //停止发火标记
	private Vector3f gundirection; //子弹指向
	private List bullets;             //子弹队列
	private float casealpha;      //车与炮塔的夹角
	
	private JLabel labelinatalas;  //在地图中的标记
	
	private int bulletnum=300;  //子弹总数
	private float firenum=50;        //喷火枪个数
	private int byshoot=0;        //中弹次数
	private float byfire=0;            //被火烧次数
	
	public TankInformation(){
		final int enemyX=10;
		final int enemyY=10;
		labelinatalas=new JLabel(){
			 protected void paintComponent(Graphics g) {
	                //super.paintComponent(g);
	                Graphics2D g2d = (Graphics2D) g.create();
	                g2d.setColor(Color.red);
	              //画圆
	                int ovalnum=5;  //个数
	                int step=(int)enemyY/(2*ovalnum);
	                int R2=(int)enemyY;
	                int ox=(int)(enemyX-enemyY)/2;
	                int oy=0;  //原点
	                for(int i=0;i<ovalnum;i++)
	                {
	                    g2d.drawOval(ox, oy, R2, R2);
	                    R2=R2-step*2;
	                    ox=ox+step;
	                    oy=oy+step;
	                }
			        g2d.dispose();
			 }
		};
		labelinatalas.setSize(enemyX, enemyY);
	}
	
	
    public JLabel getLabelinatalas() {
		return labelinatalas;
	}


	public void setLabelinatalas(JLabel labelinatalas) {
		this.labelinatalas = labelinatalas;
	}


	public float getAcceleration() {
		return acceleration;
	}
	public float getAngle() {
		return angle;
	}
	public Box getBase() {
		return base;
	}
	public float getBlood() {
		return blood;
	}
	public int getBulletnum() {
		return bulletnum;
	}
	public List getBullets() {
		return bullets;
	}
	public float getByfire() {
		return byfire;
	}
	public int getByshoot() {
		return byshoot;
	}
	public Vector3f getCardirection() {
		return cardirection;
	}
	public float getCasealpha() {
		return casealpha;
	}
	public boolean getendfireflag(){
		return endfireflag;
	}
	public float getF() {
		return F;
	}
	public FireGun getfiregun(){
		return firegun;
	}
	public float getFirenum() {
		return firenum;
	}
	public Vector3f getGundirection() {
		return gundirection;
	}
	public Vector3f getLeftdirection() {
		return leftdirection;
	}
	public Vector3f getLocaltranslation() {
		return localtranslation;
	}
	public String getName() {
		return name;
	}
	public Vector3f getNormal() {
		return normal;
	}
	public float getScore() {
		return score;
	}
	public Vector3f getSlope() {
		return slope;
	}
	public float getSpeed() {
		return speed;
	}
	public float getT() {
		return T;
	}
	public float getTotalmass() {
		return totalmass;
	}
	public void setAcceleration(float acceleration) {
		this.acceleration = acceleration;
	}
	public void setAngle(float angle) {
		this.angle = angle;
	}
	public void setBase(Box base) {
		this.base = base;
	}
	public void setBlood(float blood) {
		this.blood = blood;
	}
	public void setBulletnum(int bulletnum) {
		this.bulletnum = bulletnum;
	}
	public void setBullets(List bullets) {
		this.bullets = bullets;
	}
	public void setByfire(float byfire) {
		this.byfire = byfire;
	}
	public void setByshoot(int byshoot) {
		this.byshoot = byshoot;
	}
	public void setCardirection(Vector3f cardirection) {
		this.cardirection = cardirection;
	}
	public void setCasealpha(float casealpha) {
		this.casealpha = casealpha;
	}
	public void setendfireflag(boolean endfireflag){
		this.endfireflag=endfireflag;
	}

	public void setF(float f) {
		F = f;
	}
	public void setfiregun(FireGun firegun){
		this.firegun=firegun;
	}
	public void setFirenum(float firenum) {
		this.firenum = firenum;
	}
	public void setGundirection(Vector3f gundirection) {
		this.gundirection = gundirection;
	}
	public void setLeftdirection(Vector3f leftdirection) {
		this.leftdirection = leftdirection;
	}
	public void setLocaltranslation(Vector3f localtranslation) {
		this.localtranslation = localtranslation;
	}
	public void setName(String name) {
		this.name = name;
	}
	public void setNormal(Vector3f normal) {
		this.normal = normal;
	}
	public void setScore(float score) {
		this.score = score;
	}
	public void setSlope(Vector3f slope) {
		this.slope = slope;
	}
	public void setSpeed(float speed) {
		this.speed = speed;
	}
	public void setT(float t) {
		T = t;
	}
	public void setTotalmass(float totalmass) {
		this.totalmass = totalmass;
	}



}
